<%@ page contentType="text/html; charset=UTF-8"%>
<!DOCTYPE html>
<html>
<head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>主页</title>
</head>
<body> 


<div id="helloDiv">
您好！<%=session.getAttribute("user")%>
</div>

<br>
<br><a href="<%=request.getContextPath()%>/lgc/logout">登出</a>


<!--- 不断刷新，放在Session超时退出  -->

<script src="../js/jquery.min.js"></script>
<script>
   
       
		setInterval(refreshSession,30000);
		
		      function refreshSession(){
		         
	      	 	var data = "{}";
				$.ajax({
					type: "get",
					url: "<%=request.getContextPath()%>/lgc/hello",
					data: data,
					cache: false,
					success: function(html){
					    alert(html);
						$("#helloDiv").html(html);
					}
				});
	         }
	         
</script>

</body>
</html>